#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int find(int arr[3][3], int x, int y, int k)
{
	int i = 0,j=y-1;
	while (j > 0 && i < x)
	{
		if (arr[i][j] == k)
		{
			return 1;
		}
		else if (arr[i][j] > k)
		{
			j--;
		}
		else
		{
			i++;
		}
	}
	return 0;
}
int main()
{
	int arr[3][3] = { {1,2,3},{4,5,6},{7,8,9} };
	int ret = find(arr, 3, 3, 50);
	printf("%d", ret);
	return 0;
}